/*
 * 
 * LegendShop 多用户商城系统
 * 
 *  版权所有,并保留所有权利。
 * 
 */
package com.legendshop.oa.dao;

import java.util.List;

import com.legendshop.dao.Dao;
import com.legendshop.dao.support.CriteriaQuery;
import com.legendshop.dao.support.PageSupport;
import com.legendshop.oa.dto.ProjectQueryDto;
import com.legendshop.oa.dto.ProjectReport;
import com.legendshop.oa.dto.ProjectReportQueryDto;
import com.legendshop.oa.dto.Select2Dto;
import com.legendshop.oa.model.KeyValueEntity;
import com.legendshop.oa.model.Project;
import com.legendshop.oa.security.UserDetail;

/**
 * The Class ProjectDao. Dao接口
 */
public interface ProjectDao extends Dao<Project, Long> {
	/**
	 * 根据商城获取列表
	 */
	List<Project> getProject(String shopName);

	/**
	 * 根据Id获取
	 */
	Project getProject(Long id);

	/**
	 * 逻辑删除
	 */
	int deleteProject(Project project);
	
	
	/**
	 * 真实删除
	 */
	int deleteProjectTruely(Project project);

	/**
	 * 保存
	 */
	Long saveProject(Project project);

	/**
	 * 更新
	 */
	int updateProject(Project project);

	/**
	 * 查询列表
	 */
	PageSupport getProject(CriteriaQuery cq);

	/**
	 * 查询工程列表
	 * @param projectQueryDto
	 * @return
	 */
	PageSupport<Project> getProject(ProjectQueryDto projectQueryDto);

	Project getProjectWithModule(Long projectId);

	List<KeyValueEntity> loadProjectsEntity();
	
	List<KeyValueEntity> loadProjectsEntity(UserDetail userDetail);

	List<KeyValueEntity> loadModulesEntity(Integer projectId);

	List<ProjectReport> getProjectReport(ProjectReportQueryDto projectReportQueryDto);

	/**
	 * 更新项目工时
	 */
	boolean updateProjectWorkingTime(Long projectId);

	List<Select2Dto> queryProjectList(String username, String q, Integer pageSize, Integer currPage);

	int projectCount(String username, String q);

    List<KeyValueEntity> loadPlansEntity(Integer projectId);
}
